
<?php
$q=$_GET["q"];

$con = mysql_connect('localhost','root','');
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("books", $con);

$sql="SELECT * FROM products WHERE category = '".$q."'";

$result = mysql_query($sql);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>Online shopping </title>
	<link rel="stylesheet" href="../css/style.css" type="text/css" media="all" />
	<!--[if lte IE 6]>
		<style type="text/css" media="screen">
			.tabbed { height:420px; }
		</style>
	<![endif]-->
	
	<script src="../js/jquery-1.4.1.min.js" type="text/javascript"></script>
	<script src="../js/jquery.jcarousel.pack.js" type="text/javascript"></script>
	<script src="../js/jquery.slide.js" type="text/javascript"></script>
	<script src="../js/jquery-func.js" type="text/javascript"></script>
    	
</head>
<body>

<!-- Second Tab Content -->
				
						<div class="items">
							<div class="cl">&nbsp;</div>
							<ul>
                             <?php 
								   while($row = mysql_fetch_array($result))
  									{?>
							    <li>
                                  	<div class="image">
							    		<a href="descrip_view.php?act=view&pid=<?=$row["productid"]?>&title=<?=$row["title"]?>&Author=<?=$row["author"]?>&price=<?=$row["price"]?>&desc=<?=$row["description"]?>&img=+../images/<?php echo $row['imageurl']?>" 
                                        onclick="return hs.htmlExpand(this, { objectType: 'ajax'} )"><img src="../images/<?php echo $row['imageurl']?>" alt=""  height="100" width="100"/></a>
							    	</div>
							    	<p>
                                  	Title: <span><?php echo $row['title']?> </span><br />
							    		Author: <span><?php echo $row['author']?></span><br />
							    		Price:  <span><?php echo $row['price']?></span><br />
							    			<span><a href="buy_item.php?act=buy&pid=<?=$row["productid"]?>&title=<?=$row["title"]?>&Author=<?=$row["author"]?>&price=<?=$row["price"]?>&desc=<?=$row["description"]?>&img=+../images/<?php echo $row['imageurl']?>" ><img  src="../images/buy_now.jpg" height="50" width="140" /></a></span><br />
                                    </p>
							    	<p class="price">Wholesale Price: <strong><img src="../images/rupee.png" height="15" width="20" /><?php echo $row['price']?></strong></p>
                                   
							    </li>
                                 <?php  
									}
									mysql_close($con);
									?>
							    
							</ul>
                            <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
                    <p>&nbsp;</p>
							<div class="cl">&nbsp;</div>
						</div>
					<!-- End Second Tab Content -->
